package com.wing.product.service;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wing.common.utils.JsonResult;
import com.wing.product.dao.WarehouseProcessingDescriptionPriceDao;
import com.wing.product.model.entity.WarehouseProcessingDescriptionPrice;
import com.wing.product.model.response.WarehouseProcessingDescriptionVO;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class WarehouseProcessingDescriptionPriceServiceImpl
        extends ServiceImpl<WarehouseProcessingDescriptionPriceDao, WarehouseProcessingDescriptionPrice>
        implements WarehouseProcessingDescriptionPriceService {


    @Override
    public JsonResult saveWarehouseProcessingDescriptionPrice(WarehouseProcessingDescriptionPrice warehouseProcessingDescriptionPrice) {
        if (ObjectUtil.isNotEmpty(warehouseProcessingDescriptionPrice)){
            this.baseMapper.insert(warehouseProcessingDescriptionPrice);
            return JsonResult.success("添加成功");
        }else {
            return JsonResult.fail("添加失败");
        }
    }

    @Override
    public Page<Map> pageList4app(Page page, Map<String, Object> params) {
        List<Map> list = baseMapper.list4app(page, params);
        page.setRecords(list);
        return page;
    }
}
